Using DynamicOneDimensionalArray in Arraystack#69
Conversation
|
The API is breaking by your changes, that's why the tests are failing. We need to find out a way to keep the API intact while using |
|
I think we need only two data members, Or in fact,
|
|
We can have only dtype instead of dtype,0 in if items is None:
- items = OneDimensionalArray(dtype, maxsize)
- if not _check_type(items, OneDimensionalArray):
+ items = DynamicOneDimensionalArray(dtype, size)
…On Sat, Dec 28, 2019, 5:44 PM Gagandeep Singh ***@***.***> wrote:
I think we need only two data members, items and dtype.
ArrayStack.__new__ will change to,
class ArrayStack(...):
def __new__(cls, items=None, dtype=int):
...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#69?email_source=notifications&email_token=ALEKQUJT4DZ6LPNVULJXCYDQ247KRA5CNFSM4KAKL37KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHYIQWI#issuecomment-569411673>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALEKQUIGEMZP7T3YODL3X4LQ247KRANCNFSM4KAKL37A>
.
|
Agreed. In fact, it should be |
|
Looking at the constructor of DODA I am getting confused. Is it necessary
to give the second argument after dtype? It's *arg , so will it work if no
argument other than dtype is given?
…On Sat, Dec 28, 2019, 10:26 PM Gagandeep Singh ***@***.***> wrote:
items = DynamicOneDimensionalArray(dtype, size)
Agreed. In fact, it should be DyamicOneDimensionalArray(dtype, 0).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#69?email_source=notifications&email_token=ALEKQUMHUPVPDOS32TA3ACTQ26ANDA5CNFSM4KAKL37KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHYNUAI#issuecomment-569432577>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALEKQUIR6VE5WFIZZ7RXVTTQ26ANDANCNFSM4KAKL37A>
.
|
|
Currently the >>> from pydatastructs import DynamicOneDimensionalArray as DODA
>>> arr = DODA(int)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/czgdp1807/codezonediitj/pydatastructs/pydatastructs/linear_data_structures/arrays.py", line 207, in __new__
obj = super().__new__(cls, dtype, *args, **kwargs)
File "/home/czgdp1807/codezonediitj/pydatastructs/pydatastructs/linear_data_structures/arrays.py", line 70, in __new__
raise ValueError("1D array cannot be created due to incorrect"
ValueError: 1D array cannot be created due to incorrect information. |
|
We can change the behaviour after some discussion but in a different PR. |
|
Can we change the code of DODA, having it's default size 0? Just asking I'm
general.
…On Sun, Dec 29, 2019, 12:37 AM Gagandeep Singh ***@***.***> wrote:
Currently the size doesn't defaults to 0, so you have to give 0 as the
second argument.
>>> from pydatastructs import DynamicOneDimensionalArray as DODA>>> arr = DODA(int)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/czgdp1807/codezonediitj/pydatastructs/pydatastructs/linear_data_structures/arrays.py", line 207, in __new__
obj = super().__new__(cls, dtype, *args, **kwargs)
File "/home/czgdp1807/codezonediitj/pydatastructs/pydatastructs/linear_data_structures/arrays.py", line 70, in __new__
raise ValueError("1D array cannot be created due to incorrect"ValueError: 1D array cannot be created due to incorrect information.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#69?email_source=notifications&email_token=ALEKQUJJK4APNF57DL4QQR3Q26PY5A5CNFSM4KAKL37KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHYQIMA#issuecomment-569443376>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALEKQUIO3OBBSAVC2MD7V63Q26PY5ANCNFSM4KAKL37A>
.
|
As said above you can do that, but in a different PR(from a different branch). |
|
okay, how is my performance till now? More efforts needed, where am I
lacking?i wish to have a feedback from you.
…On Sun, Dec 29, 2019 at 12:42 AM Gagandeep Singh ***@***.***> wrote:
We can change the behaviour after some discussion but in a different PR.
As said above you can do that, but in a different PR(from a different
branch).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#69?email_source=notifications&email_token=ALEKQUJRQXTLIGXX2R2QXW3Q26QLDA5CNFSM4KAKL37KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHYQLHY#issuecomment-569443743>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALEKQUKFKAIMKH7EXOOOMELQ26QLDANCNFSM4KAKL37A>
.
|
|
Thanks for the contributions first of all. It's a great experience to work with you. Hoping that you will keep communicating and contributing in this way in future too. :-) |
|
Sure.
…On Sun, Dec 29, 2019, 12:47 AM Gagandeep Singh ***@***.***> wrote:
Thanks for the contributions first of all. It's a great experience to work
with you. Hoping that you will keep communicating and contributing in this
way in future too. :-)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#69?email_source=notifications&email_token=ALEKQUJGDETVUKBQ7BSJIATQ26Q6BA5CNFSM4KAKL37KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHYQN2Y#issuecomment-569444075>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALEKQUOLNNUWYL6W6DMBI7LQ26Q6BANCNFSM4KAKL37A>
.
|
|
Please update the documentation as well for the new API. The tests failing due to that. |
|
By documentation you means the comments in the code right?
…On Sun, Dec 29, 2019, 10:50 PM Gagandeep Singh ***@***.***> wrote:
Please update the documentation as well for the new API.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#69?email_source=notifications&email_token=ALEKQUOEDPWFCTZWRANFNT3Q3DL7BA5CNFSM4KAKL37KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHZEFLA#issuecomment-569524908>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALEKQUL2652W622IMEWF72DQ3DL7BANCNFSM4KAKL37A>
.
|
|
Yes, the comments in the code. I have made some edits in my previous comments which should be visible if you open github. |
|
Will see soon.
…On Sun, Dec 29, 2019, 10:53 PM Gagandeep Singh ***@***.***> wrote:
Yes, the comments in the code. I have made some edits in my previous
comments which should be visible if you open github.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#69?email_source=notifications&email_token=ALEKQUJSMGCAMIQOC7MSELDQ3DMI5A5CNFSM4KAKL37KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHZEHBA#issuecomment-569525124>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALEKQUNSTQPS5NUAXGHBG2TQ3DMI5ANCNFSM4KAKL37A>
.
|
|
Please make sure that your code passes the recently added code quality tests. See the logs here. There are few trailing white spaces in your code. |
|
To test your code quality locally, update the master branch by pulling the latest changes and merge into |
Codecov Report
@@ Coverage Diff @@
## master #69 +/- ##
============================================
- Coverage 98.17% 97.671% -0.499%
============================================
Files 19 23 +4
Lines 1257 1503 +246
============================================
+ Hits 1234 1468 +234
- Misses 23 35 +12
|
|
Thanks. Merging. |
|
If you want you can add your name to https://github.com/codezonediitj/pydatastructs/blob/master/AUTHORS by making a separate PR. |
Fixes #67.